package work_a;

import java.util.Comparator;
import java.util.Random;
import java.util.TreeSet;

public class TreeSet_test2 {
    public static void main(String[] args) {
        TreeSet<Integer> integers = new TreeSet<>(new Comparator<Integer>() {


            @Override
            public int compare(Integer o1, Integer o2) {
                int result = o2-o1;
                return result;


            }
        });
        Random random=new Random();
        for (int i = 0; i < 11; i++) {
            int i1 = random.nextInt(51) + 50;
            integers.add(i1);

        }
        System.out.println(integers);
    }

}
